window.addEventListener('load', adaptation);
window.addEventListener('resize', adaptation);

function adaptation() {
	var w = document.body.clientWidth;
	var h = document.body.clientHeight;
	var nw = 1920;
	nh = 1080;
	var scalW = w / 1920;
	var scalH = h / 1080;
	var scale;
	if (scalW >= scalH) {
		scale = scalH;
		
	} else {
		scale = scalW;
		
	}
	document.getElementById('main').setAttribute('style', 'transform: scale(' + scale + ',' + scale + ') translateX(-50%)' );
}